﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
    	<title>视频关联</title>
<jsp:include page="common/header.jsp"/>
	</head>
	<body>
		<b>选择视频：</b>
		<form action="item-related.action" method="get">
			<input type="text" name="item">
			<input type="submit" value="查询">(注：点击下列图片也可选择相应视频)
		</form>
		<hr>
<c:if test="${item>0}">
		<b>当前选择视频：</b>
		<table>
			<tr>
				<th>编号：</th><td align="center">${item}</td>
			</tr>
			<tr>
				<th>图片：</th><td width="132"><img src="${ss:getItemImage(item)}"></td>
			</tr>
			<tr>
				<th>标题：</th><td align="center">${ss:getItemName(item,jdbcTemplate)}</td>
			</tr>
		</table>
		<hr>
		<b>在看该视频之前还看了(数据来源于CV4的lastPlayItemId)：</b>
		<table>
			<tr>
				<th>序号：</th>
<c:forEach var="r" items="${topsBefore}" varStatus="vs">
				<td align="center">${vs.index+1}</td>
</c:forEach>
			</tr>
			<tr>
				<th>图片：</th>
<c:forEach var="r" items="${topsBefore}">
				<td width="132"><a href="item-related.action?item=${r.itemA}"><img src="${ss:getItemImage(r.itemA)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>标题：</th>
<c:forEach var="r" items="${topsBefore}">
				<td align="center">${ss:getItemName(r.itemA,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>人数：</th>
<c:forEach var="r" items="${topsBefore}">
				<td align="center">${r.rate}</td>
</c:forEach>
			</tr>
		</table>
		<hr>
		<b>在看该视频之后还看了(数据来源于CV4的lastPlayItemId)：</b>
		<table>
			<tr>
				<th>序号：</th>
<c:forEach var="r" items="${topsAfter}" varStatus="vs">
				<td align="center">${vs.index+1}</td>
</c:forEach>
			</tr>
			<tr>
				<th>图片：</th>
<c:forEach var="r" items="${topsAfter}">
				<td width="132"><a href="item-related.action?item=${r.itemB}"><img src="${ss:getItemImage(r.itemB)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>标题：</th>
<c:forEach var="r" items="${topsAfter}">
				<td align="center">${ss:getItemName(r.itemB,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>人数：</th>
<c:forEach var="r" items="${topsAfter}">
				<td align="center">${r.rate}</td>
</c:forEach>
			</tr>
		</table>
		<hr>
		<b>看了该视频的人还看了(数据来源于CV4同一juid的所有CV)：</b>
		<table>
			<tr>
				<th>序号：</th>
<c:forEach var="r" items="${topItems}" varStatus="vs">
				<td align="center">${vs.index+1}</td>
</c:forEach>
			</tr>
			<tr>
				<th>图片：</th>
<c:forEach var="r" items="${topItems}">
	<c:choose>
		<c:when test="${item==r.itemA}">
				<td width="132"><a href="item-related.action?item=${r.itemB}"><img src="${ss:getItemImage(r.itemB)}"></a></td>
		</c:when>
		<c:otherwise>
				<td width="132"><a href="item-related.action?item=${r.itemA}"><img src="${ss:getItemImage(r.itemA)}"></a></td>
		</c:otherwise>
	</c:choose>
</c:forEach>
			</tr>
			<tr>
				<th>标题：</th>
<c:forEach var="r" items="${topItems}">
	<c:choose>
		<c:when test="${item==r.itemA}">
				<td align="center">${ss:getItemName(r.itemB,jdbcTemplate)}</td>
		</c:when>
		<c:otherwise>
				<td align="center">${ss:getItemName(r.itemA,jdbcTemplate)}</td>
		</c:otherwise>
	</c:choose>
</c:forEach>
			</tr>
			<tr>
				<th>人数：</th>
<c:forEach var="r" items="${topItems}">
				<td align="center">${r.rate}</td>
</c:forEach>
			</tr>
		</table>
</c:if>
		<hr>
		<b>被相同用户观看过的视频Top10(数据来源于CV4同一juid的所有CV)：</b>
		<table>
			<tr>
				<th>序号：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td align="center">${vs.index+1}</td>
</c:forEach>
			</tr>
			<tr>
				<th>视频A<BR>图片：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td width="132"><a href="item-related.action?item=${r.itemA}"><img src="${ss:getItemImage(r.itemA)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>视频A<BR>标题：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td align="center">${ss:getItemName(r.itemA,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>视频B<BR>图片：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td width="132"><a href="item-related.action?item=${r.itemB}"><img src="${ss:getItemImage(r.itemB)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>视频B<BR>标题：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td align="center">${ss:getItemName(r.itemB,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>人数：</th>
<c:forEach var="r" items="${tops}" varStatus="vs">
				<td align="center">${r.rate}</td>
</c:forEach>
			</tr>
		</table>
		<hr>
		<b>被相同用户观看过的视频Top10(数据来源于CV4的lastPlayItemId)：</b>
		<table>
			<tr>
				<th>序号：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td align="center">${vs.index+1}</td>
</c:forEach>
			</tr>
			<tr>
				<th>视频A<BR>图片：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td width="132"><a href="item-related.action?item=${r.itemA}"><img src="${ss:getItemImage(r.itemA)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>视频A<BR>标题：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td align="center">${ss:getItemName(r.itemA,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>视频B<BR>图片：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td width="132"><a href="item-related.action?item=${r.itemB}"><img src="${ss:getItemImage(r.itemB)}"></a></td>
</c:forEach>
			</tr>
			<tr>
				<th>视频B<BR>标题：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td align="center">${ss:getItemName(r.itemB,jdbcTemplate)}</td>
</c:forEach>
			</tr>
			<tr>
				<th>人数：</th>
<c:forEach var="r" items="${tops1}" varStatus="vs">
				<td align="center">${r.rate}</td>
</c:forEach>
			</tr>
		</table>
	</body>
</html>
